class @ShowProfileView extends CustomView
    
    el: $("#main")

    initialize: ->
        super
        @model.bind("change", @render)
        @model.fetch()

    render: ->
        @GetTemplate(SiteMap.Account.ShowProfileTemplate, (compiledTemplate) =>
            $(@el).html(compiledTemplate(@model.toJSON()))
        )

    events: 
        "click li.show-profile-rated-books": "showProfileRatedBooks"
        "click button.add-to-friends": "addToFriends"
        "click button.send-message": "sendMessage"
        "click li.show-prifile-friends" : "getFriends"

    showProfileRatedBooks: (e)->
        e.preventDefault()
        url = SiteMap.Account.ShowProfileRatedBooks + "/" + @model.get("Login")
        @Navigate(url, true)

    addToFriends: (e) ->
        e.preventDefault()

    sendMessage: (e) ->
        e.preventDefault()
        view = new SendMessageView()
        view.render()

    getFriends: (e) ->
        e.preventDefault()
        url = SiteMap.Friends.FriendsListing + "/"+ @model.get("Login")
        @Navigate(url,true)
